<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>AngularJSCollectionDataTraverse</title>
		<script type="text/javascript" src="../js/angular.min.js"></script>
	</head>
	<!--<body ng-app>-->
	<body ng-app="myapp" ng-controller="myctrl">
		<!--<div ng-app="myapp" ng-controller="myctrl">
			<div>
				<input type="text" name="name" ng-model ="name" />	-->
				<!--<input type="button" value="清空" ng-click="clearVal()" />-->
			<!--	<input type="button" value="清空" ng-click="name=''" />
			</div>
			<div>
				Hello,{{name}}
			</div>	
		</div>
		<script type="text/javascript">
			var myapp = angular.module("myapp",[]);
			
			myapp.controller("myctrl",["$scope",function($scope){
				$scope.name="AJSModel";
				
				/*$scope.clearVal=function(){
					$scope.name="";	
				}*/
			}]);
		</script>-->
		<table width="100%" border="1">
			<th>序号</th>
			<th>商品编号</th>
			<th>商品名称</th>
			<th>价格</th>
			<tr ng-repeat="product in products">
				<td>{{$index+1}}</td>
				<td>{{product.id}}</td>
				<td>{{product.name}}</td>
				<td>{{product.price}}</td>
			</tr>
		</table>
	</body>
	<script type="text/javascript">
		var myapp = angular.module("myapp",[]);
		myapp.controller("myctrl",["$scope",function($scope){
			$scope.products = [
				{
					id:1001,
					name:'数码相机',
					price:3000
				},
				{
					id:1002,
					name:'苹果手机',
					price:7000
				}
			];
		}]);
	</script>
</html>
